package com.miaohy.demo.service.impl;

import com.miaohy.demo.entity.Test;
import com.miaohy.demo.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class TestService {

    @Autowired
    TestMapper testMapper;

    @Cacheable(value = "users", key = "#id")
    public Test getTest(Integer id) {
        return testMapper.selectById(id);
    }
}
